package com.itheima;

import com.itheima.dao.BookDao;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

import javax.sql.DataSource;

public class App {
    public static void main( String[] args ) {
//        1.加载类路径下的配置文件
          ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
//        2.文件系统下加载配置文件
//          ApplicationContext context1 =new FileSystemXmlApplicationContext("E:\\springmvc\\spring_10_container\\src\\main\\resources\\applicationContext.xml");
//          BookDao bookDao = (BookDao) context.getBean("bookDao");
//          BookDao bookDao =context.getBean("bookDao", BookDao.class);
            BookDao bookDao = (BookDao) context.getBean(BookDao.class);
            bookDao.save();
    }
}
